# Use official Python 3.10 image as base image
FROM python:3.10-slim

# Set working directory
WORKDIR /app

# Update package manager and install system dependencies
RUN apt-get update && apt-get install -y \
    curl \
    gcc \
    && rm -rf /var/lib/apt/lists/*

# Create non-root user
RUN useradd --create-home --shell /bin/bash app && chown -R app:app /app
USER app

# Copy project files
COPY . /app

# Install the package
RUN pip install --no-cache-dir .

# Create default config directory
RUN mkdir -p /app/config

# Expose port
EXPOSE 8000

# Set default startup command
ENTRYPOINT ["incloud-mcp-server"]
CMD ["run", "--config", "/app/config/config.yaml", "--transport", "sse", "--host", "0.0.0.0"]
